package newcoder;

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.CompareGenerator;

import java.lang.reflect.Array;
import java.util.*;


class ListNode {
    int val;
    ListNode next;

    ListNode(int x) {
        val = x;
        next = null;
    }
}


public class BM5 {
    public static void main(String[] args) {

        ArrayList<ArrayList<ListNode>> lists = new ArrayList<>();


        PriorityQueue<ListNode> pq = new PriorityQueue<>(new Comparator<ListNode>() {
            public int compare(ListNode o1, ListNode o2) {
                return o1.val-o2.val;
            }});
        for(int i=0;i<lists.size();i++){
            int j=0;
            while(j<lists.get(i).size()){
                pq.add(lists.get(i).get(j++));
            }
        }
        ListNode head = pq.poll();
        ListNode node = head;
        while(pq.size()!=0){
            node.next = pq.poll();
        }

    }
}


